// @charset "utf-8";
define(function (require, exports, module) {
	
	var CommonMethod = function(){
		// 全局初始化
		this.init = function(){  
			// 禁止右击菜单
			document.oncontextmenu=function(event) {  
			    if (document.all) { 
			        window.event.returnValue = false;}// for IE  
			    else {  
			        event.preventDefault();
			      }  
			}; 
		};
		// 查询数组中val的index
		this.arrIndexOf = function(arr, val){
			for(var i = 0; i < arr.length; i++){
				if(arr[i] === val) {return i;}
			}
			return -1;
		};
		// 删除数组中某一个val
		this.arrRemove = function(arr,val) {
			var index = this.arrIndexOf(arr,val);
			if(index > -1){
				arr.splice(index,1);
			}
			return arr;
		};
		// input转义字符处理,不要添加其他
		this.escapeHtml = function(string){
			var entityMap = {
				"<" : "&lt;",
				">" : "&gt;"
			};
			return String(string).replace(/[<>]/g,function(s){
				return entityMap[s];
			});
		};

	};

	module.exports = new CommonMethod();
});